package com.gopay.common.domain.log;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

/** 
 * 快捷支付发送校验短信日志
 * @ClassName: BisExpaySmsSendLog 
 * @author w_jiqing 
 * @date 2016年12月1日 上午10:13:34  
 */ 

@Entity
@Table(name = "BIS_EXPAY_SMS_SEND_LOG")
public class BisExpaySmsSendLog extends BaseEntity{

    private static final long serialVersionUID = -3744428476892628468L;

    /**
     * 记录流水号
     */
    private int sq;
    
    /**
     *国付宝订单号
     */
    private String orderId;
    
    /**
     * 模块ID
     */
    private String moduleId;
       
    /**
     * 手机号
     */
    private String mobileNum;
        
    /**
     * 卡号
     */
    private String cardNo;
    
    /**
     * 操作方
     */
    private String  operateSource;
    
    /**
     * 创建时间
     */
    private Date createdTime;
    
    /**
     * 备用字段
     */
    private String remark;

    @Id
    @SequenceGenerator(name="BIS_EXPAY_SMS_SEND_LOG_SEQ", sequenceName="BIS_EXPAY_SMS_SEND_LOG_SEQ" )
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="BIS_EXPAY_SMS_SEND_LOG_SEQ")
    @Column(name="SQ")
    public int getSq() {
        return sq;
    }

    public void setSq(int sq) {
        this.sq = sq;
    }



    @Column(name = "GOPAY_ORDER_ID",nullable = false, length = 30)
    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    @Column(name = "MODULE_ID", nullable = false, length = 2)
    public String getModuleId() {
        return moduleId;
    }

    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }

    @Column(name = "MOBILE_NUM", nullable = false, length = 150)
    public String getMobileNum() {
        //return mobileNum;
        /**
         * modified by zyt 2017-4-14 自动重新加密并解密返回
         */
        this.mobileNum = SensitiveInfoUtils.autoReencrypt(this.mobileNum);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.mobileNum);
    }

    public void setMobileNum(String mobileNum) {
        //this.mobileNum = mobileNum;
        /**
         * modified by zyt 2017-4-10 写操作的时候做加密
         */
        this.mobileNum = SensitiveInfoUtils.smartEncryptWithCheck(mobileNum);
    }

    @Column(name = "CARD_NO", nullable = false, length = 150)
    public String getCardNo() {
        //return cardNo;
        /**
         * modified by zyt 2017-4-14 自动重新加密并解密返回
         */
        this.cardNo = SensitiveInfoUtils.autoReencrypt(this.cardNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.cardNo);
    }

    public void setCardNo(String cardNo) {
        //this.cardNo = cardNo;
        /**
         * modified by zyt 2017-4-10 写操作的时候做加密
         */
        this.cardNo = SensitiveInfoUtils.smartEncryptWithCheck(cardNo);
    }



    @Column(name = " OPERATE_SOURCE", nullable = false, length = 1)
    public String getOperateSource() {
        return operateSource;
    }

    public void setOperateSource(String operateSource) {
        this.operateSource = operateSource;
    }

    @Column(name = "CREATED_TIME")
    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    @Column(name = "REMARK")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
